﻿namespace VectorPicsEditor.Controls
{
    using System.Drawing;
    using System.Windows.Forms;

    public partial class CommonProperties : UserControl
    {
        protected ShapeWrapper Shape;
        protected ComboBox ShapesComboBox;

        public CommonProperties()
        {
            this.InitializeComponent();
        }

        protected virtual Color? OpenColorDialog()
        {
            ColorDialog dlg = new ColorDialog();
            var result = dlg.ShowDialog();
            if (result == DialogResult.OK)
            {
                return dlg.Color;
            }

            return null;
        }

        public virtual void Initialize(ShapeWrapper shape, ComboBox comboBox)
        {
            this.Shape = shape;
            ShapesComboBox = comboBox;
        }
    }
}